package com.design.alex.observer;

/**
 * @ClassName : BinaryObserver
 * @Description : todo
 * @Author : Alex
 * @Date: 2020-02-19 17:23
 */
public class BinaryObserver extends Observer {

    public BinaryObserver(Subject subject) {
        this.subject = subject;
        this.subject.attach(this);
    }

    @Override
    public void update() {
        System.out.println("Binary String: " + Integer.toBinaryString(subject.getState()));
    }
}
